﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WindowsApplication1;

namespace QLNhaSach
{
    public partial class LoginUser : Form
    {
        public LoginUser()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string username = textEdit1.Text;
            string password = textEdit2.Text;
            if (username == "admin" && password == "admin")
            {
                this.Hide();
                Form1 frm = new Form1();
                frm.Userid = 1;
                frm.Show();

            }
            else if (username == "user" && password == "user")
            {
                this.Hide();
                Form1 frm = new Form1();
                frm.Userid = 2;
                frm.Show();
            }else{
                MessageBox.Show("Username hoặc password không chính xác.");
            }
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            Environment.Exit(1);
        }
    }
}
